home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 February: Tool Chest / Dev.CD Feb 97 TC.toast / Sample Code / Development Tools & Languages / AppsToGo / DTS.Lib / DTS.Lib.headers / Print.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-09-22  |  2.4 KB  |  77 lines  |  [TEXT/MPS ]

  1. #ifndef __PRINT__
  2. #define __PRINT__
  3.  
  4. #ifndef __TYPES__
  5. #include <Types.h>
  6. #endif
  7.  
  8.  
  9.  
  10. #ifdef __cplusplus
  11. extern "C" {
  12. #endif
  13.  
  14.  
  15.  
  16. OSErr            PrintDocument(FileRecHndl frHndl, Boolean jobDlg, Boolean firstJob);
  17.     /*
  18.     **    ¶ Print-loop function for AppsToGo document.
  19.     **
  20.     **    INPUT:    frHndl
  21.     **            jobDlg
  22.     **            firstJob
  23.     **    RESULT:    OSErr
  24.     **
  25.     **    This print-loop function is designed to be called under various situations.
  26.     **    The big issue that it handles is finder printing.  If multiple documents
  27.     **    are to be printed from the finder, the user should only see one job dialog
  28.     **    for all the files.  (If a job dialog is shown for each file, how does the
  29.     **    user know for which file the dialog is for?)  So, for situations where
  30.     **    there is more than one file to be printed, call this code the first time
  31.     **    with the firstJob boolean true.  Normally, the jobDlg boolean will also
  32.     **    be true, except that under 7.0, you may be printing in the background.
  33.     **    If this is the case, you don’t want a job dialog for even the first file,
  34.     **    and you should pass in false for the jobDlg boolean in this case.  For
  35.     **    files 2-N, you should pass false for both booleans.  For regular application
  36.     **    printing, you should pass true for both booleans, since the file is the
  37.     **    first (only) file, and you are not in the background.
  38.     **
  39.     **    After calling this function to print a document, you need to call it
  40.     **    again with a nil document handle.  The print record for the first (or only)
  41.     **    document printed is preserved in a static variable.  This is so that the
  42.     **    job dialog information can be passed on to documents 2-N in the print job.
  43.     **    Calling this function with the document handle nil tells this function
  44.     **    that you are done printing documents, and that the print record for the
  45.     **    first job can be disposed of. */
  46.  
  47.  
  48.  
  49. void            DonePrinting(void);
  50.     /*
  51.     **    ¶ Called after using PrintDocument for cleanup.
  52.     **
  53.     **    DonePrinting makes sure that PrintDocument gets rid of the prMergeHndl
  54.     **    print record that is used for multiple document printing.  Call this
  55.     **    after the last document is printed, or you get a memory leak. */
  56.  
  57.  
  58.  
  59. OSErr            PresentStyleDialog(FileRecHndl frHndl);
  60.     /*
  61.     **    ¶ Given document handle, present style dialog for document.
  62.     **
  63.     **    RESULT:    OSErr
  64.     **
  65.     **    Call this from the application to present a style dialog.  The changes are
  66.     **    automatically saved in the document. */
  67.  
  68.  
  69.  
  70. #ifdef __cplusplus
  71. }
  72. #endif
  73.  
  74.  
  75.  
  76. #endif
  77.